package com.center.biz.impl;

import com.center.api.model.SysRole;
import com.center.api.remote.RemoteSysRoleService;
import com.center.biz.dao.SysRoleMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(version = "1.0",interfaceClass = RemoteSysRoleService.class)
public class RemoteSysRoleServiceImpl implements RemoteSysRoleService{

    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Override
    public int save(SysRole sysRole) {
        return sysRoleMapper.insertSelective(sysRole);
    }

    @Override
    public int update(SysRole sysRole) {
        return sysRoleMapper.updateByPrimaryKeySelective(sysRole);
    }

    @Override
    public int delete(int id) {
        return sysRoleMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<SysRole> select(SysRole sysRole) {
        return sysRoleMapper.select(sysRole);
    }

    @Override
    public SysRole getById(int id) {
        return sysRoleMapper.selectByPrimaryKey(id);
    }
}
